﻿
<InfoCard Href="@("/articles/index/" + Model.Id)" BriefIntroduction="@Model.BriefIntroduction" Image="@Model.MainImage" InfoItems="GetInfoItems()" Name="@Model.Name" Type="@Model.Type.GetDisplayName()" HideTitle="HideTitle" Outline="Outline" />


@code {
    [Parameter]
    public ArticleInforTipViewModel Model { get; set; }
    [Parameter]
    public bool Outline { get; set; }
    [Parameter]
    public bool HideTitle { get; set; }

    public List<(IconType,string)> GetInfoItems()
    {
        var items= new List<(IconType, string)>
        {
            (IconType.DeterminedTime,Model.LastEditTime.ToString("yyyy-MM-dd")),
            (IconType.Comment,Model.CommentCount.ToString()+"条评论"),
            (IconType.Read,Model.ReaderCount.ToString()+"次阅读"),
            (IconType.ThumbsUp,Model.ThumbsUpCount.ToString()+"人点赞"),
        };
        if (string.IsNullOrWhiteSpace(Model.CreateUserName) == false)
        {
            items.Add((IconType.User, Model.CreateUserName));
        }
        return items;
    }
}
